class Episode < ActiveRecord::Base
  belongs_to :show
  
  def self.new_from_rss(episode_data_parser)    
    episode = new()
    episode.parse_rss(episode_data_parser)
    return episode
  end
  
  def parse_rss(episode_data_parser)
    self.season = episode_data_parser.season
    self.show_number = episode_data_parser.episode
    self.torrent_group = episode_data_parser.torrent_group
    self.published_date = episode_data_parser.pub_date
  end
end
